package com.hsjk.szwj.module.pay.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hsjk.szwj.module.pay.dal.dataobject.system.MchInfoDO;
import com.hsjk.szwj.module.pay.dal.mysql.IMchInfoMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author chenjiawei
 * @desc
 * @Date 2023/08/21 16:12
 **/
@Service
public class MchInfoServiceImpl implements IMchInfoService {

    @Resource
    private IMchInfoMapper mchInfoMapper;

    @Override
    public MchInfoDO getMchInfoById(Long id) {
        return mchInfoMapper.getMchInfoById(id);
    }

    @Override
    public MchInfoDO getMchInfoByNo(String mchNo) {
        return mchInfoMapper.selectOne(new LambdaQueryWrapper<MchInfoDO>()
                .eq(MchInfoDO::getMchNo, mchNo));
    }

    @Override
    public MchInfoDO getMchInfoByTenant() {
        return mchInfoMapper.selectOne(new LambdaQueryWrapper<>());
    }

    @Override
    public List<MchInfoDO> list(LambdaQueryWrapper<MchInfoDO> wrapper) {
        return mchInfoMapper.selectList(wrapper);
    }
}
